import java.util.ArrayList;
import java.util.Iterator;

public class Test {
    public static void main(String[] args) {
        String ch1 = "welcome to bit";
        String ch2 = "come";
        deleteCharactor1(ch1, ch2);
    }
    public static void deleteCharactor2(String ch1, String ch2) {
        ArrayList<Character> l = new ArrayList<>();
        for (int i = 0; i < ch1.length(); i++) {
            char ch = ch1.charAt(i);
            if (!ch2.contains(ch+"")) {
                l.add(ch);
            }
        }
        for (int i = 0; i < l.size(); i++) {
            if (l.get(i)!= 0x20) {
                System.out.print(l.get(i));
            }
        }
        System.out.println();
        for (Character x: l) {
            System.out.print(x);
        }
        System.out.println();
        Iterator<Character> it = l.iterator();
        while (it.hasNext()) {
            System.out.print(it.next());
        }
    }
    public static void deleteCharactor1(String ch1, String ch2) {
        ArrayList<Character> l = new ArrayList<Character>();
        for (int i = 0; i < ch1.length(); i++) {
            int flag = 0;
            for (int j = 0; j < ch2.length(); j++) {
                if ((ch1.charAt(i) != ch2.charAt(j))) {
                    flag = 1;
                } else {
                    flag = 0;
                    break;
                }
            }
            if (flag == 1) {
                l.add(ch1.charAt(i));
            }
        }
        for (int i = 0; i < l.size(); i++) {
            System.out.print(l.get(i));
        }
        System.out.println();

    }
}
